﻿
using OpenCvSharp;

using Xc.DataAccess.CodeReader.Properties;
using Xc.DataAccess.Core;

namespace Xc.DataAccess.CodeReader.Models.Filters
{
    [Filter("叠加",FilterType.Algorithm)]
    public class AlgorithmAdd:FilterBase
    {
        [InputParameter("图片")]
        public Mat Image2 { get; set; } = new Mat();
        [InputParameter("遮罩")] 
        public Mat Mask { get; set; } = new Mat();
        [InputParameter("类型")]
        public int DType { get; set; } = -1;
        internal override ResultData<Mat> UseChannel(Mat mat, FilterBase[] filterInfos, FilterBase preFilterBase)
        {
            Mat dst = new Mat();
            Cv2.Add(mat, Image2,dst, Mask,DType);
            return ResultData<Mat>.Accept(TextResource.filter_action_complete, dst);
        }
    }

}
